package top.kaoshanji.q1ch06a.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/5/21 18:11
 */
@Configuration
public class WebConfiguration {

    // 代码清单-q1ch06a-199页a：覆盖自动配置已有的消息转换器Bean
    @Bean
    public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter () {
        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();

        return converter;
    }

    // 代码清单-q1ch06a-200页a：添加额外的自定义转换器
    @Bean
    public HttpMessageConverter customConverters() {
        return null;
    }


}
